﻿using UnityEngine;

public struct MoveParams
{
    public float SpeedMax { get; private set; }
    public float SpeedIncrement { get; private set; }
    public float SpeedTimeInterval { get; private set; }
    public Vector3 Speed { get; private set; }

    public static MoveParams createFromWallParams(WallModel wallModel)
    {
        MoveParams result = new MoveParams();

        result.SpeedMax = wallModel.SpeedMax;
        result.SpeedIncrement = wallModel.SpeedIncrement;
        result.SpeedTimeInterval = wallModel.SpeedTimeInterval;
        result.Speed = new Vector3(-wallModel.SpeedInitial, 0, 0);

        return result;
    }

    public static MoveParams createFromObstacleParams(ObstacleModel obstacle)
    {
        MoveParams result = new MoveParams();

        result.SpeedMax = obstacle.SpeedMax;
        result.SpeedIncrement = obstacle.SpeedIncrement;
        result.SpeedTimeInterval = obstacle.SpeedTimeInterval;
        result.Speed = new Vector3(-obstacle.SpeedInitial, 0, 0);

        return result;
    }
}